package com.paperobot.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.paperobot.dao.BaseDao;
import com.paperobot.dao.PaperTypeDao;
import com.paperobot.model.PaperType;

@Repository("paperTypeDao")
public class PaperTypeDaoImpl extends BaseDao implements PaperTypeDao{

	public Long addPaperType(PaperType paperType) throws Exception {
		Object obj=	saveObject("addPaperType", paperType);
		if(null!=obj){
			return (Long)obj;
		}
		return -1L;
	}

	public int deletePaperType(Long paperTypeId) throws Exception {
		return deleteObject("deletePaperType", paperTypeId);
	}

	public PaperType getPaperType(Long paperTypeId) throws Exception {
		return (PaperType) getObject("getPaperType", paperTypeId);
	}

	@SuppressWarnings("unchecked")
	public List<PaperType> getPaperTypeList(Map<String, Object> map)throws Exception {
		return (List<PaperType>) getObjects("getPaperTypeList", map);
	}

	public int updatePaperType(PaperType paperType) throws Exception {
		return updateObject("updatePaperType", paperType);
	}

}
